// <copyright file="ContextInit.cs" company="Clever Software">
// Copyright (c) 2013, 2014 All Right Reserved, http://www.cleversoftware.by
//
// This source is subject to the Microsoft Permissive License.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// </copyright>
// <author>Clever Software</author>
// <email>info@cleversoftware.by</email>
// <date>2014-02-04</date> 
// <summary>CleverCMS source code</summary>

namespace CleverCMS.Cms.Data
{
    using System;
    using System.Collections.Generic;
    using System.Data.Entity;
    using System.Linq;
    using Cms.Data.Entities;

    public class CmsContextInit : DropCreateDatabaseIfModelChanges<CmsDataContext>
    {
        protected override void Seed(CmsDataContext context)
        {
            #region Pages category
            var categories = new List<CmsPageCategory>
            {
                new CmsPageCategory { Title = "/", CreatedAt = DateTime.Now },
                new CmsPageCategory { Title = "Default Category", ParentId = 1, CreatedAt = DateTime.Now},
                new CmsPageCategory { Title = "Some Usefull Category", ParentId = 1, CreatedAt = DateTime.Now},
            };
            categories.ForEach(s => context.CmsPageCategories.Add(s));
            context.SaveChanges();
            #endregion

            #region Pages state
            var statuses = new List<CmsStatus>
            {
                new CmsStatus(StatusCode.Draft) { StatusName = "Draft", Description="Draft Page", CreatedAt=DateTime.Now},
                new CmsStatus(StatusCode.Dropped) { StatusName = "Dropped", Description="Dropped Page", CreatedAt=DateTime.Now},
                new CmsStatus(StatusCode.Published) { StatusName = "Published", Description="Published Page", CreatedAt=DateTime.Now}
            };
            statuses.ForEach(s => context.Statuses.Add(s));
            context.SaveChanges();
            #endregion

            #region Menus
            var menuTypes = new List<CmsMenuType>
            {
                new CmsMenuType() { Title = "Menu", Type="TopMenu", Description="Top Menu", CreatedAt=DateTime.Now},    
                new CmsMenuType() { Title = "Menu", Type="AdminMenu", Description="Admin Menu", CreatedAt=DateTime.Now}
            };
            menuTypes.ForEach(s => context.CmsMenuTypes.Add(s));
            context.SaveChanges();
            #endregion

            #region Pages
            var pages = new List<CmsPage>
            {
                new CmsPage
                {
                    CategoryId = 2,
                    Alias = "main",
                    MetaDescription = "CleverCMS - content management system which specialize in building portals, blogs, or article based content and much more!",
                    MetaKeywords = "cms, blog, content management, asp.net, asp.net mvc",
                    PageContent = @"<h1 style='text-align: center;'><img alt='' height='202' src='http://cleversoftware.by/images/product box_small.jpg' style='font-family: Arial; font-size: 13px; line-height: 20px; float: left;' width='200' /></h1>
                    <h1><strong>&nbsp; &nbsp; </strong></h1>
                    <h1><strong>&nbsp; &nbsp; Welcome to the CleverCMS!</strong></h1>
                    <p style='box-sizing: border-box; margin-bottom: 2px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; color: rgb(127, 127, 127); font-size: 20px; text-align: justify; font-family: lato, sans-serif; padding-left: 220px !important;'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'><strong style='box-sizing: border-box; margin: 0px; padding: 0px;'>&nbsp; &nbsp; Build your websites with us!</strong></span></p>
                    <p style='box-sizing: border-box; margin-top: 15px; margin-bottom: 2px; padding: 0px; color: rgb(127, 127, 127); font-size: 20px; text-align: justify; font-family: lato, sans-serif;'>&nbsp;</p>
                    <h2 style='box-sizing: border-box; margin-top: 20px; padding: 0px; font-family: lato, sans-serif; font-weight: 900; line-height: 1.1; color: rgb(127, 127, 127); font-size: 24px; letter-spacing: 2px; text-transform: uppercase;'>&nbsp;</h2>
                    <h2 style='box-sizing: border-box; margin-top: 20px; padding: 0px; font-family: lato, sans-serif; font-weight: 900; line-height: 1.1; color: rgb(127, 127, 127); font-size: 24px; letter-spacing: 2px; text-transform: uppercase;'>&nbsp;</h2>
                    <h2 style='box-sizing: border-box; margin-top: 20px; padding: 0px; font-family: lato, sans-serif; font-weight: 900; line-height: 1.1; color: rgb(127, 127, 127); font-size: 24px; letter-spacing: 2px; text-transform: uppercase;'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>WHAT IS&nbsp;</span><a href='http://clevercms.cleversoftware.by' style='box-sizing: border-box; margin: 0px; padding: 0px; background-color: transparent; color: rgb(66, 139, 202); cursor: pointer;'>CLEVERCMS</a>?</h2>
                    <p style='box-sizing: border-box; margin-bottom: 2px; padding: 0px; color: rgb(127, 127, 127); font-size: 20px; text-align: justify; font-family: lato, sans-serif;'><strong style='box-sizing: border-box; margin: 0px; padding: 0px;'>CleverCMS</strong>&nbsp;is an open source (MS-PL) Content Management System. It is built using&nbsp;<strong style='box-sizing: border-box; margin: 0px; padding: 0px;'>ASP.NET MVC</strong>, which provides website developers with a simple, easy to use utility to allow building small-ish (dozens to hundreds of pages), semi-static websites or even complex systems by extending the base with new modules (Areas).</p>
                    <p style='box-sizing: border-box; margin-top: 15px; margin-bottom: 2px; padding: 0px; color: rgb(127, 127, 127); font-size: 20px; text-align: justify; font-family: lato, sans-serif;'><br style='box-sizing: border-box; margin: 0px; padding: 0px;' />
                    Typically, our tool is used for corporate websites, or a website promoting a team or organization, etc. This is where we shine. There are other content management packages which specialize in building portals, blogs, or article based content, etc.&nbsp;<strong style='box-sizing: border-box; margin: 0px; padding: 0px;'>CleverCMS</strong>&nbsp;can do&nbsp;<strong style='box-sizing: border-box; margin: 0px; padding: 0px;'>all of this&nbsp;</strong>and<strong style='box-sizing: border-box; margin: 0px; padding: 0px;'>&nbsp;much more</strong>!</p>
                    <p style='box-sizing: border-box; margin-top: 15px; margin-bottom: 2px; padding: 0px; color: rgb(127, 127, 127); font-size: 20px; text-align: justify; font-family: lato, sans-serif;'>Check us out and see yourself!</p>
                    <h2 style='box-sizing: border-box; margin-top: 20px; padding: 0px; font-family: lato, sans-serif; font-weight: 900; line-height: 1.1; color: rgb(127, 127, 127); font-size: 24px; letter-spacing: 2px; text-transform: uppercase;'>&nbsp;</h2>
                    <h2 style='box-sizing: border-box; margin-top: 20px; padding: 0px; font-family: lato, sans-serif; font-weight: 900; line-height: 1.1; color: rgb(127, 127, 127); font-size: 24px; letter-spacing: 2px; text-transform: uppercase;'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>WHO SHOULD USE&nbsp;</span><a href='http://clevercms.cleversoftware.by' style='box-sizing: border-box; margin: 0px; padding: 0px; background-color: transparent; color: rgb(66, 139, 202); cursor: pointer;'>CLEVERCMS</a>?</h2>
                    <p style='box-sizing: border-box; margin-bottom: 2px; padding: 0px; color: rgb(127, 127, 127); font-size: 20px; text-align: justify; font-family: lato, sans-serif;'>If you&#39;re a professional web developer. If you have found that sometimes creating a corporate or organization website is difficult in some of the other content management systems. If you have found that other CMS&#39;s are sometimes &quot;overkill&quot; for what you need. If you want to be able to hand off the content management to inexperienced editors. If you want complete control over the layout and appearance of the site, and you know how to do it... If you want an easy to use, yet expandable tool, then&nbsp;<strong style='box-sizing: border-box; margin: 0px; padding: 0px;'>CleverCMS</strong>&nbsp;is for you.</p>
                    <p>&nbsp;</p>
                    <h3 style='box-sizing: border-box; margin-top: 20px; padding: 0px; font-family: lato, sans-serif; font-weight: 900; line-height: 1.1; color: rgb(127, 127, 127); font-size: 24px; letter-spacing: 2px; text-transform: uppercase;'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>FOLLOWING ADD-ON MODULES/PLUGINS IN THE FRONTEND:</span></h3>
                    <ul style='box-sizing: border-box; margin-left: 20px; font-size: 20px; color: rgb(51, 51, 51); font-family: lato, sans-serif;'>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Dynamic multilevel menu with quick page adding functionality&nbsp;</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Breadcrumb</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>User account management</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Twitter and Facebook login</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Dynamically Created Pages with&nbsp;ability on the fly modification</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Full text search based on popular open source Lucene.NET search engine</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Blog with certain widgets like archive latest etc</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Comments functionality which applies to both Blog and Pages</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Content Rating functionality</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Custom pages for error handling</span></li>
                    </ul>
                    <h3 style='box-sizing: border-box; margin-top: 20px; padding: 0px; font-family: lato, sans-serif; font-weight: 900; line-height: 1.1; color: rgb(127, 127, 127); font-size: 24px; letter-spacing: 2px; text-transform: uppercase;'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>IN THE BACKEND:</span></h3>
                    <ul style='box-sizing: border-box; margin-left: 20px; font-size: 20px; color: rgb(51, 51, 51); font-family: lato, sans-serif;'>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Complete content management module</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Complete multilevel menu management module</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Complete Blog management module including Tags, Comments</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>File Manager</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Complete Basic user management module</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Free HTML widgets management</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Health state monitor based on Exception logging subsystem</span></li>
	                    <li style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(72, 161, 70);'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>Dashboard</span></li>
                    </ul>
                    <h3 style='box-sizing: border-box; margin-top: 20px; padding: 0px; font-family: lato, sans-serif; font-weight: 900; line-height: 1.1; color: rgb(127, 127, 127); font-size: 24px; letter-spacing: 2px; text-transform: uppercase;'>&nbsp;</h3>
                    <p style='box-sizing: border-box; margin-bottom: 2px; padding: 0px; color: rgb(127, 127, 127); font-size: 20px; text-align: justify; font-family: lato, sans-serif;'><strong style='box-sizing: border-box; margin: 0px; padding: 0px;'><span style='box-sizing: border-box; margin: 0px; padding: 0px; color: rgb(0, 0, 0);'>If you have a questions/comments do not hesitate to ask at</span>&nbsp;<a href='mailto:info@cleversoftware.by' style='box-sizing: border-box; margin: 0px; padding: 0px; background-color: transparent; color: rgb(66, 139, 202); cursor: pointer;'>info@cleversoftware.by</a></strong></p>
                    ",
                    StatusId = (int) StatusCode.Published,
                    PageTitle = "Welcome to CleverCMS!",
                    SeoTitle = "Welcome to CleverCMS. Build your websites with us!",
                    ModifiedAt = DateTime.Now,
                    CreatedAt = DateTime.Now
                },
                new CmsPage
                {
                    CategoryId = 1,
                    Alias = "page-with-rating",
                    MetaDescription = "CleverCMS: Sample page with rating functionality",
                    MetaKeywords = "cms, rating functionality, rating content",
                    PageContent = @"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque commodo enim vel sapien eleifend malesuada. Vestibulum scelerisque felis sit amet consequat rutrum. Phasellus condimentum euismod purus, eget luctus magna venenatis sed. Cras ut mauris vitae dui blandit eleifend. Curabitur rutrum dui et nisi pulvinar, id aliquet mauris volutpat. Curabitur sem nunc, accumsan vitae aliquet at, auctor et massa. Ut ut pretium metus, scelerisque commodo felis. Vivamus nec diam sodales, vehicula diam vitae, volutpat massa. Quisque ornare diam orci, eu rutrum nunc rhoncus egestas. Fusce ut est ullamcorper, tincidunt eros non, faucibus turpis. In non neque mauris.</p>
                    <p><img alt='' src='/Uploads//MyFolder/gallery/image11.jpg' style='opacity: 0.9; width: 200px; height: 150px; border-width: 3px; border-style: solid; margin: 10px; float: left;' /></p>
                    <p>Vivam&nbsp;<span style='line-height: 1.6em;'>us vi&nbsp;</span><span style='line-height: 1.6em;'>tae lect</span><span style='line-height: 1.6em;'>us sem. Aenean malesuada, lorem et venenatis adipiscing, risus velit eleifend lectus, et facilisis nibh mauris eget nisi. Aliquam orci lacus, rhoncus eu ornare blandit, gravida vitae dui. Fusce in iaculis elit. In egestas, sem sed tempus tempus, leo justo lacinia metus, a condimentum urna quam quis tortor. Maecenas viverra accumsan cursus. Cras ut tellus id dui ultricies elementum. Aliquam fringilla ve</span></p>
                    <p>stibulum metus id tempus. Morbi sed lobortis nulla, in consequat tortor. Nulla convallis ante id leo vehicula convallis. Curabitur condimentum lacus massa, id sollicitudin ipsum venenatis sed.</p>
                    <p>Phasellus id laoreet leo. Nam porttitor luctus libero ac ultrices. Mauris eu urna ornare, vulputate lorem ut, suscipit magna. Proin tempus mollis lorem, quis eleifend risus gravida ut. Mauris at elit id lacus ullamcorper tincidunt. Praesent non ligula et lacus blandit pretium at a magna. Donec malesuada est massa, non tempus nisi mollis et. Nam nec tempus odio, ac gravida magna. Nulla ac mi ac risus rhoncus ornare sit amet nec velit. Mauris placerat libero vitae ipsum posuere tempus. Cras dolor tortor, egestas cursus condimentum in, tincidunt eget eni<span style='line-height: 1.6em;'>m. Nunc metus tellus, commodo at lacus vitae, lobortis porttitor metus. Fusce vitae luctus lacus. Maecenas mauris ipsum, dignissim eget mi eget, imperdiet cursus turpis. Nulla sed magna ut lacus dapibus fermentum quis eu mauris.</span></p>
                    <p>Mauris fermentum enim in ipsum cursus, at feugiat lorem aliquam. Suspendisse vulputate fringilla sem eget mattis. Curabitur lacus est, rutrum nec pellentesque consequat, dictum vitae neque. Fusce dignissim blandit bibendum. Mauris eget nibh egestas, aliquam nisl at, condimentum nulla. Praesent sit amet varius eros, eget volutpat sapien. Sed adipiscing lacinia fermentum. Nunc a imperdiet leo, in pulvinar ligula. Nulla ac euismod massa. Quisque ultrices magna ipsum, at laoreet erat tristique at. Nullam sodales tincidunt nisl at condimentum. Suspendisse tincidunt leo id arcu sagittis elementum. Aenean hendrerit lorem vel nulla eleifend faucibus. Nam semper dolor vel elit tincidunt, vitae hendrerit libero volutpat.</p>
                    <p>Etiam tincidunt porta tortor, eget ullamcorper dolor. Quisque vestibulum tellus ut mollis rhoncus. Duis fringilla, dolor nec elementum mattis, risus libero ornare eros, vel imperdiet ligula dolor ac magna. Suspendisse ut tempor justo. Sed eu sollicitudin turpis. Maecenas sem quam, cursus sed ultricies in, egestas a metus. Aenean vulputate semper dignissim. Aliquam non ipsum lobortis, imperdiet dui eu, imperdiet urna.</p>
                    ",
                    StatusId = (int) StatusCode.Published,
                    PageTitle = "Sample page with rating functionality",
                    SeoTitle = "CleverCMS: Sample page with rating functionality",
                    ModifiedAt = DateTime.Now,
                    CreatedAt = DateTime.Now,
                    ShowRating = true
                },
                new CmsPage
                {
                    CategoryId = 3,
                    Alias = "page-with-comments",
                    MetaDescription = "CleverCMS: Sample page with comments functionality",
                    MetaKeywords = "cms, comments functionality, commenting content",
                    PageContent = @"<div>&nbsp;</div>
                    <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In eget nibh a dui rutrum venenatis. Vivamus consectetur mattis nunc et mollis. Cras ac porta justo, et ornare lacus. Nam non ornare neque. Quisque ullamcorper purus non lorem vestibulum iaculis. Morbi fringilla, eros vitae semper blandit, eros dui accumsan velit, sed mattis ante justo nec libero. Maecenas auctor, diam a adipiscing molestie, elit velit fermentum justo, dictum tincidunt mi neque id nibh. Cras sed porttitor est. Aliquam ut cursus ante. Quisque rutrum tincidunt mi, vel lobortis magna rhoncus in. Vestibulum vitae laoreet sem. Vestibulum interdum sed ante id pulvinar.&nbsp;<span style='line-height: 1.6em;'>Maecenas sollicitudin eros magna, sed aliquam nisi feugiat in. Ut a varius dui, vitae luctus magna. In porta sapien nulla, vel sodales tellus mattis eu. Sed sit amet rutrum erat, quis euismod metus. Morbi turpis velit, faucibus in lectus quis, placerat tincidunt turpis. Nulla facilisi. Aliquam adipiscing metus at metus gravida imperdiet. Proin a fringilla orci, ac eleifend erat. Fusce rhoncus tincidunt urna, a euismod risus ullamcorper et. Proin convallis lorem sit amet fermentum imperdiet. Mauris eget tempor nisi. Proin elit leo, malesuada ut lorem pellentesque, laoreet congue sapien.</span></div>
                    <div>&nbsp;</div>
                    <div><img alt='' src='/Uploads//MyFolder/gallery/image8.jpg' style='width: 250px; height: 188px; border-width: 3px; border-style: solid; margin: 10px; float: left;' /></div>
                    <div>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Phasellus sed turpis libero. In hac habitasse platea dictumst. Sed mattis augue lorem, nec vestibulum lacus rhoncus eget. Aenean at consequat ipsum, vel mattis felis. Curabitur velit metus, placerat vitae nibh quis, feugiat ornare massa. Aliquam vel dui et leo tristique eleifend. Integer quis ipsum lorem. Interdum et malesuada fames ac ante ipsum primis in faucibus. Aliquam nec lectus aliquam, pretium dolor vitae, vulputate lectus. Suspendisse pretium euismod augue, at rutrum lorem malesuada nec. Ut luctus, nibh eget vehicula auctor, diam nulla congue leo, ac pellentesque nunc neque sed magna. Proin vel nunc sed velit tincidunt posuere. Praesent sit amet metus at turpis elementum ornare quis sit amet nisi. Nam dapibus adipiscing tellus eget tincidunt. Pellentesque vel tellus interdum, molestie sem vitae, fringilla eros.Phasellus in justo vehicula, congue urna gravida, bibendum mi. Donec a augue quis neque accumsan hendrerit sit amet a lectus. Etiam aliquam urna vel arcu iaculis, vitae auctor purus blandit. Nulla a nunc tempor, commodo lorem vitae, pulvinar dui. In vel quam in lorem vestibulum aliquet. Sed at ullamcorper augue, eget tempor augue.&nbsp;Vestibulum interdum sed ante id pulvinar.&nbsp;<span style='line-height: 1.6em;'>Maecenas sollicitudin eros magna, sed aliquam nisi feugiat in. Ut a varius dui, vitae luctus magna. In porta sapien nulla, vel sodales tellus mattis eu. Sed sit amet rutrum erat, quis euismod metus. Morbi turpis velit, faucibus in lectus quis, placerat tincidunt turpis. Nulla facilisi. Aliquam adipiscing metus at metus gravida imperdiet. Proin a fringilla orci, ac eleifend erat. Fusce rhoncus tincidunt urna, a euismod risus ullamcorper et.</span>Nam dapibus adipiscing tellus eget tincidunt. Pellentesque vel tellus interdum, molestie sem vitae, fringilla eros.Phasellus in justo vehicula, congue urna gravida, bibendum mi. Donec a augue quis neque accumsan hendrerit sit amet a lectus. Etiam aliquam urna vel arcu iaculis, vitae auctor purus blandit. Nulla a nunc tempor, commodo lorem vitae, pulvinar dui</div>
                    <div>&nbsp;</div>
                    <div>Nam consequat venenatis eros, at cursus risus tristique vel. Interdum et malesuada fames ac ante ipsum primis in faucibus. Proin sed sem volutpat, gravida velit quis, ornare urna. Curabitur imperdiet non quam eget porttitor. Nullam placerat, sapien vel convallis bibendum, velit orci gravida orci, nec lacinia nisl leo nec magna. Sed a nisl quis dui varius malesuada. Maecenas non nisl mi. Nam consequat, augue non ullamcorper scelerisque, dolor dolor aliquam nunc, at laoreet neque tellus nec dui. Nulla cursus odio sit amet purus sollicitudin, sed lobortis magna dictum. Phasellus in justo vehicula, congue urna gravida, bibendum mi. Donec a augue quis neque accumsan hendrerit sit amet a lectus. Etiam aliquam urna vel arcu iaculis, vitae auctor purus blandit. Nulla a nunc tempor, commodo lorem vitae, pulvinar dui. In vel quam in lorem vestibulum aliquet. Sed at ullamcorper augue, eget tempor augue. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</div>
                    ",
                    StatusId = (int) StatusCode.Published,
                    PageTitle = "Sample page with comments functionality",
                    SeoTitle = "CleverCMS: Sample page with comments functionality",
                    ModifiedAt = DateTime.Now,
                    CreatedAt = DateTime.Now,
                    ShowRating = true,
                    HasComments = true
                }
            };
            foreach (var page in pages)
            {
                context.CmsPages.Add(page);
            }
            context.SaveChanges();
            #endregion

            #region MenuItems
            //main
            var menu1 = new CmsMenuItem { Id = 1, Title = "Content", MenuId = 2, EntryId = null, NavigateUrl = "/", ParentId = null, Visible = true, SortOrder = 1, Icon = "file", CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu1);

            var menu2 = new CmsMenuItem { Id = 2, Title = "Blog", MenuId = 2, EntryId = null, NavigateUrl = "/", ParentId = null, Visible = true, SortOrder = 2, Icon = "list-alt", CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu2);

            var menu3 = new CmsMenuItem { Id = 3, Title = "Menues", MenuId = 2, EntryId = null, NavigateUrl = "/", ParentId = null, Visible = true, SortOrder = 3, Icon = "tasks", CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu3);

            var menu4 = new CmsMenuItem { Id = 4, Title = "Users", MenuId = 2, EntryId = null, NavigateUrl = "/", ParentId = null, Visible = true, SortOrder = 4, Icon = "user", CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu4);

            var menu5 = new CmsMenuItem { Id = 5, Title = "Monitor", MenuId = 2, EntryId = null, NavigateUrl = "/", ParentId = null, Visible = true, SortOrder = 5, Icon = "bell-alt", CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu5);
            
            //content
            var menu6 = new CmsMenuItem { Id = 6, Title = "Pages", MenuId = 2, EntryId = null, NavigateUrl = "/admin/page/list", ParentId = 1, Visible = true, SortOrder = 1, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu6);

            var menu7 = new CmsMenuItem { Id = 7, Title = "Ratings", MenuId = 2, EntryId = null, NavigateUrl = "/admin/rating/list", ParentId = 1, Visible = true, SortOrder = 3, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu7);

            var menu8 = new CmsMenuItem { Id = 8, Title = "Tags", MenuId = 2, EntryId = null, NavigateUrl = "/admin/tag/list", ParentId = 1, Visible = true, SortOrder = 4, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu8);

            var menu9 = new CmsMenuItem { Id = 9, Title = "File Manager", MenuId = 2, EntryId = null, NavigateUrl = "/admin/fileupload/files", ParentId = 1, Visible = true, SortOrder = 6, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu9);

            var menu10 = new CmsMenuItem { Id = 10, Title = "Widgets", MenuId = 2, EntryId = null, NavigateUrl = "/admin/settings/list", ParentId = 1, Visible = true, SortOrder = 5, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu10);

            var menu25 = new CmsMenuItem { Id = 25, Title = "Comments", MenuId = 2, EntryId = null, NavigateUrl = "/admin/comment/list", ParentId = 1, Visible = true, SortOrder = 2, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu25);
            
            //blog
            var menu11 = new CmsMenuItem { Id = 11, Title = "Posts", MenuId = 2, EntryId = null, NavigateUrl = "/admin/blog/list", ParentId = 2, Visible = true, SortOrder = 1, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu11);

            var menu12 = new CmsMenuItem { Id = 12, Title = "Ratings", MenuId = 2, EntryId = null, NavigateUrl = "/admin/rating/listposts", ParentId = 2, Visible = true, SortOrder = 3, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu12);

            var menu13 = new CmsMenuItem { Id = 13, Title = "Comments", MenuId = 2, EntryId = null, NavigateUrl = "/admin/comment/listposts", ParentId = 2, Visible = true, SortOrder = 2, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu13);

            var menu26 = new CmsMenuItem { Id = 26, Title = "Tags", MenuId = 2, EntryId = null, NavigateUrl = "/admin/tag/listposts", ParentId = 2, Visible = true, SortOrder = 4, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu26);
          
            //menu
            var menu14 = new CmsMenuItem { Id = 14, Title = "Top Menu", MenuId = 2, EntryId = null, NavigateUrl = "/admin/menuitem/list/1", ParentId = 3, Visible = true, SortOrder = 1, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu14);

            var menu15 = new CmsMenuItem { Id = 15, Title = "Admin Menu", MenuId = 2, EntryId = null, NavigateUrl = "/admin/menuitem/list/2", ParentId = 3, Visible = true, SortOrder = 2, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu15);
            //user
            var menu16 = new CmsMenuItem { Id = 16, Title = "Users", MenuId = 2, EntryId = null, NavigateUrl = "/admin/accounts/list", ParentId = 4, Visible = true, SortOrder = 1, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu16);

            var menu17 = new CmsMenuItem { Id = 17, Title = "Roles", MenuId = 2, EntryId = null, NavigateUrl = "/admin/role/list", ParentId = 4, Visible = true, SortOrder = 2, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu17);
            //monitor
            var menu18 = new CmsMenuItem { Id = 18, Title = "Health State", MenuId = 2, EntryId = null, NavigateUrl = "/admin/monitor/list", ParentId = 5, Visible = true, SortOrder = 1, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu18);
            
            //top menu
            var menu19 = new CmsMenuItem { Id = 19, Title = "Home", MenuId = 1, EntryId = null, NavigateUrl = "/", ParentId = null, Visible = true, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu19);

            var menu20 = new CmsMenuItem { Id = 20, Title = "Sub menu item", MenuId = 1, EntryId = pages.FirstOrDefault().Id, NavigateUrl = "/", ParentId = menu19.Id, Visible = true, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu20);

            var menu21 = new CmsMenuItem { Id = 21, Title = "Page with Rating", MenuId = 1, EntryId = null, NavigateUrl = "/pages/page-with-rating", ParentId = null, Visible = true, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu21);

            var menu22 = new CmsMenuItem { Id = 22, Title = "Page with Comments", MenuId = 1, EntryId = null, NavigateUrl = "/pages/page-with-comments", ParentId = null, Visible = true, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu22);

            var menu23 = new CmsMenuItem { Id = 23, Title = "Blog", MenuId = 1, EntryId = null, NavigateUrl = "/blog", ParentId = null, Visible = true, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu23);

            var menu24 = new CmsMenuItem { Id = 24, Title = "404", MenuId = 1, EntryId = null, NavigateUrl = "/some-none-existing-page", ParentId = null, Visible = true, CreatedAt = DateTime.Now };
            context.CmsMenuItems.Add(menu24);

            context.SaveChanges();
            #endregion

            #region Users

            context.UserProfiles.Add(new UserProfile { CreatedAt = DateTime.Now, DisplayName = "Batman", Login = "batman", Email = "batman@batman.com" });
            context.UserProfiles.Add(new UserProfile { CreatedAt = DateTime.Now, DisplayName = "Superman", Login = "superman", Email = "superman@superman.com" });
            context.SaveChanges();

            #endregion

            #region Rating
            var ratings = new List<CmsRating>
            {
                new CmsRating { PageId = 2, Rating = 4.75, UserId = 1},
                new CmsRating { PageId = 3, Rating = 4.25, UserId = 1},
            };
            ratings.ForEach(x => context.PageRatings.Add(x));
            context.SaveChanges();
            #endregion

            #region Comments

            var comments = new List<CmsPageComment>
            {
                new CmsPageComment { PageId = 3, Comment = "Hey, Thats a pretty cool stuff!", CreatedAt = DateTime.Today, Email="batman@batman.com", Name="Batman"},
                new CmsPageComment { PageId = 3, ParentId=1, Comment = "Yeah! looks brilliant.", CreatedAt=DateTime.Today, Email="superman@superman.com", Name="Superman" },
                new CmsPageComment { PageId = 3, Comment = "Look, mates where did you take your userpic? It looks same as mine! Did you steal it :)?", CreatedAt=DateTime.Today, Email="spiderman@spiderman.com", Name="Spiderman" },
                new CmsPageComment { PageId = 3, ParentId=3, Comment = "Noooo man, this is just a defaut one! I guess, they should use gravatar for that kind of stuff ...", CreatedAt=DateTime.Today, Email="ninja_t@ninja.com", Name="Ninja turtle" },
                new CmsPageComment { PageId = 3, ParentId=3, Comment = "Finally ! Dudes, you are awsome, you'e addded Gravatar support. Thanks!", CreatedAt=DateTime.Today, Email="ninja_t@ninja.com", Name="Ninja turtle" },
               
            };
            comments.ForEach(x => context.PageComments.Add(x));
            context.SaveChanges();

            #endregion

            #region Tags

            var tag1 = new CmsTag() { Name = "Tag1", CreatedAt = DateTime.Now, Pages = new List<CmsPage>() };
            tag1.Pages.Add(context.CmsPages.ToList()[0]);
            tag1.Pages.Add(context.CmsPages.ToList()[1]);
            context.CmsTags.Add(tag1);

            var tag2 = new CmsTag() { Name = "Tag2", CreatedAt = DateTime.Now, Pages = new List<CmsPage>() };
            tag2.Pages.Add(context.CmsPages.ToList()[1]);
            tag2.Pages.Add(context.CmsPages.ToList()[2]);
            context.CmsTags.Add(tag2);

            var tag3 = new CmsTag() { Name = "Tag3", CreatedAt = DateTime.Now, Pages = new List<CmsPage>() };
            tag3.Pages.Add(context.CmsPages.ToList()[2]);
            tag3.Pages.Add(context.CmsPages.ToList()[0]);
            context.CmsTags.Add(tag3);

            context.SaveChanges();

            #endregion

            base.Seed(context);
        }
    }
}